import { INCREMNET } from '../constant'

// 同步action，action为一般对象
export const incrementAction = data => ({type: INCREMNET, data})
// 异步action，action的值为函数，异步action中一般会调用同步action
export const asyncAction = (data, time) => {
    return dispatch => {
        setTimeout(() => {
            dispatch(incrementAction(data))
        }, time)
    }
}